package com.loanapp.server.market.api.bbs.api;


import com.loanapp.server.market.api.bbs.entity.Comment;
import com.loanapp.server.market.api.bbs.hystrix.CommentApiFallbackFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "loanapp-server-market-provider",path =CommentApi.mapping,fallbackFactory = CommentApiFallbackFactory.class)
public interface CommentApi {

    static String mapping="comment";

    @RequestMapping(value = "insert",method = RequestMethod.POST)
    Long insert(Comment comment) throws Exception;

    @RequestMapping(value = "getCommentByPid",method = RequestMethod.POST)
    List<Map<String, Object>> getCommentByPid(@RequestParam("pid") Long pid,@RequestBody int[] params) throws Exception;
}
